// 题目链接：https://www.luogu.com.cn/problem/P2440
#include <iostream>
#include <algorithm>

using namespace std;

const int N = 100010;
int n, k;
int arr[N];

bool check(int arr[], int len, int num, int x)
{
    int cnt = 0;
    for (int i = 1; i <= len; ++i)
    {
        cnt += (arr[i] / x);
    }

    if (cnt >= num)
        return true;
    else
        return false;
}

int binary_search(int arr[], int len, int num, int longgest)
{
    int l = 0, r = longgest + 1;
    int mid;
    while (l + 1 < r)
    {
        mid = (l + r) / 2;

        if (check(arr, len, num, mid))
            l = mid;
        else
            r = mid;
    }
    return l;
}

int main()
{
    long long sum = 0;
    int longgest;
    scanf("%d %d", &n, &k);
    for (int i = 1; i <= n; ++i)
    {
        scanf("%d", &arr[i]);
        sum += arr[i];
    }
    longgest = sum / k;
    int res = binary_search(arr, n, k, longgest);
    if (res != -1)
        printf("%d", res);
    else
        printf("%d", 0);

    return 0;
}